home *** CD-ROM | disk | FTP | other *** search
-
- Polymer('core-transition', {
-
- type: 'transition',
-
- /**
- * Run the animation.
- *
- * @method go
- * @param {Node} node The node to apply the animation on
- * @param {Object} state State info
- */
- go: function(node, state) {
- this.complete(node);
- },
-
- /**
- * Set up the animation. This may include injecting a stylesheet,
- * applying styles, creating a web animations object, etc.. This
- *
- * @method setup
- * @param {Node} node The animated node
- */
- setup: function(node) {
- },
-
- /**
- * Tear down the animation.
- *
- * @method teardown
- * @param {Node} node The animated node
- */
- teardown: function(node) {
- },
-
- /**
- * Called when the animation completes. This function also fires the
- * `core-transitionend` event.
- *
- * @method complete
- * @param {Node} node The animated node
- */
- complete: function(node) {
- this.fire('core-transitionend', null, node);
- },
-
- /**
- * Utility function to listen to an event on a node once.
- *
- * @method listenOnce
- * @param {Node} node The animated node
- * @param {string} event Name of an event
- * @param {Function} fn Event handler
- * @param {Array} args Additional arguments to pass to `fn`
- */
- listenOnce: function(node, event, fn, args) {
- var self = this;
- var listener = function() {
- fn.apply(self, args);
- node.removeEventListener(event, listener, false);
- }
- node.addEventListener(event, listener, false);
- }
-
- });
-